package com.example.win.android_banduyujia.peopleactivity.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.io.Serializable;
import java.util.List;

/**
 * Created by huchun on 2015/8/15.
 */
public class ViewPageAdapter extends FragmentPagerAdapter implements Serializable {

    private static final long serialVersionUID = 1L;
    private List<Fragment>   mListFragments;

    public ViewPageAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        mListFragments = list;
    }

    @Override
    public Fragment getItem(int position) {
        if(mListFragments != null){
            return mListFragments.get(position);
        }
        return null;
    }

    @Override
    public int getCount() {
        if(mListFragments != null){
            return mListFragments.size();
        }
        return 0;
    }
}
